home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / PowerPC / Dev / PPCRelease / Examples / Timer / .out next >
Encoding:
Text File  |  1999-07-28  |  19.0 KB  |  1,996 lines

  1. # 1 "PPCTimer.c"
  2. # 1 "include:exec/types.h" 1
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.    
  32.   
  33.  
  34.  
  35.  
  36. typedef void           *APTR;         
  37.  
  38. typedef long        LONG;         
  39. typedef unsigned long    ULONG;         
  40. typedef unsigned long    LONGBITS;    
  41. typedef short        WORD;         
  42. typedef unsigned short    UWORD;         
  43. typedef unsigned short    WORDBITS;    
  44.  
  45. typedef signed char    BYTE;         
  46.  
  47.  
  48.  
  49. typedef unsigned char    UBYTE;         
  50. typedef unsigned char    BYTEBITS;    
  51. typedef unsigned short    RPTR;         
  52.  
  53.  
  54.  
  55.  
  56. typedef unsigned char  *STRPTR;      
  57.  
  58.  
  59.  
  60.  
  61. typedef short        SHORT;         
  62. typedef unsigned short    USHORT;      
  63. typedef short        COUNT;
  64. typedef unsigned short    UCOUNT;
  65. typedef ULONG        CPTR;
  66.  
  67.  
  68.  
  69. typedef float        FLOAT;
  70. typedef double        DOUBLE;
  71. typedef short        BOOL;
  72. typedef unsigned char    TEXT;
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. # 1 "include:sys/commnull.h" 1
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. # 79 "include:exec/types.h" 2
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.   
  103.  
  104.  
  105.  
  106.  
  107.  
  108. # 1 "PPCTimer.c" 2
  109.  
  110. # 1 "include:exec/nodes.h" 1
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132. struct Node {
  133.     struct  Node *ln_Succ;     
  134.     struct  Node *ln_Pred;     
  135.     UBYTE   ln_Type;
  136.     BYTE    ln_Pri;         
  137.     char    *ln_Name;         
  138. };     
  139.  
  140.  
  141. struct MinNode {
  142.     struct MinNode *mln_Succ;
  143.     struct MinNode *mln_Pred;
  144. };
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178. # 2 "PPCTimer.c" 2
  179.  
  180. # 1 "include:exec/lists.h" 1
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200. struct List {
  201.    struct  Node *lh_Head;
  202.    struct  Node *lh_Tail;
  203.    struct  Node *lh_TailPred;
  204.    UBYTE   lh_Type;
  205.    UBYTE   l_pad;
  206. };     
  207.  
  208.  
  209.  
  210.  
  211. struct MinList {
  212.    struct  MinNode *mlh_Head;
  213.    struct  MinNode *mlh_Tail;
  214.    struct  MinNode *mlh_TailPred;
  215. };     
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238. # 3 "PPCTimer.c" 2
  239.  
  240. # 1 "include:exec/memory.h" 1
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260. struct    MemChunk {
  261.     struct  MemChunk *mc_Next;     
  262.     ULONG   mc_Bytes;         
  263. };
  264.  
  265.  
  266.  
  267.  
  268. struct    MemHeader {
  269.     struct  Node mh_Node;
  270.     UWORD   mh_Attributes;     
  271.     struct  MemChunk *mh_First;  
  272.     APTR    mh_Lower;         
  273.     APTR    mh_Upper;         
  274.     ULONG   mh_Free;         
  275. };
  276.  
  277.  
  278.  
  279.  
  280. struct    MemEntry {
  281. union {
  282.     ULONG   meu_Reqs;         
  283.     APTR    meu_Addr;         
  284.     } me_Un;
  285.     ULONG   me_Length;         
  286. };
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296. struct    MemList {
  297.     struct  Node ml_Node;
  298.     UWORD   ml_NumEntries;     
  299.     struct  MemEntry ml_ME[1];     
  300. };
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330. struct MemHandlerData
  331. {
  332.     ULONG    memh_RequestSize;     
  333.     ULONG    memh_RequestFlags;     
  334.     ULONG    memh_Flags;         
  335. };
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345. # 4 "PPCTimer.c" 2
  346.  
  347. # 1 "include:utility/tagitem.h" 1
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377. typedef ULONG Tag;
  378.  
  379. struct TagItem
  380. {
  381.     Tag      ti_Tag;     
  382.     ULONG ti_Data;     
  383. };
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425. # 5 "PPCTimer.c" 2
  426.  
  427. # 1 "../../include/powerup/ppclib/interface.h" 1
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515. struct Caos
  516. {
  517.     union
  518.     {
  519.         int    Offset;
  520.         APTR    Function;
  521.     } caos_Un;
  522.     ULONG    M68kCacheMode;
  523.     APTR    M68kStart;
  524.     ULONG    M68kLength;
  525.     ULONG    PPCCacheMode;
  526.     APTR    PPCStart;
  527.     ULONG    PPCLength;
  528.     ULONG    d0;
  529.     ULONG    d1;
  530.     ULONG    d2;
  531.     ULONG    d3;
  532.     ULONG    d4;
  533.     ULONG    d5;
  534.     ULONG    d6;
  535.     ULONG    d7;
  536.     ULONG    a0;
  537.     ULONG    a1;
  538.     ULONG    a2;
  539.     ULONG    a3;
  540.     ULONG    a4;
  541.     ULONG    a5;
  542.  
  543.  
  544.  
  545.  
  546.     ULONG    a6;
  547. };
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566. struct ModuleArgs
  567. {
  568.     ULONG    M68kCacheMode;
  569.     APTR    M68kStart;
  570.     ULONG    M68kLength;
  571.     ULONG    PPCCacheMode;
  572.     APTR    PPCStart;
  573.     ULONG    PPCLength;
  574.  
  575.     ULONG    Arg1;     
  576.     ULONG    Arg2;     
  577.     ULONG    Arg3;     
  578.     ULONG    Arg4;     
  579.     ULONG    Arg5;     
  580.     ULONG    Arg6;     
  581.     ULONG    Arg7;     
  582.     ULONG    Arg8;     
  583.     DOUBLE    FArg1;     
  584.     DOUBLE    FArg2;     
  585.     DOUBLE    FArg3;     
  586.     DOUBLE    FArg4;     
  587.     DOUBLE    FArg5;     
  588.     DOUBLE    FArg6;     
  589.     DOUBLE    FArg7;     
  590.     DOUBLE    FArg8;     
  591. };
  592.  
  593.  
  594. # 6 "PPCTimer.c" 2
  595.  
  596. # 1 "../../include/powerup/ppclib/time.h" 1
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681. # 7 "PPCTimer.c" 2
  682.  
  683. # 1 "../../include/powerup/gcclib/powerup_protos.h" 1
  684.  
  685.  
  686.  
  687. # 1 "include:dos/dos.h" 1
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739. struct DateStamp {
  740.    LONG     ds_Days;           
  741.    LONG     ds_Minute;           
  742.    LONG     ds_Tick;           
  743. };  
  744.  
  745.  
  746.  
  747.  
  748. struct FileInfoBlock {
  749.    LONG      fib_DiskKey;
  750.    LONG      fib_DirEntryType;   
  751.  
  752.    char      fib_FileName[108];  
  753.    LONG      fib_Protection;     
  754.    LONG      fib_EntryType;
  755.    LONG      fib_Size;          
  756.    LONG      fib_NumBlocks;      
  757.    struct DateStamp fib_Date; 
  758.    char      fib_Comment[80];   
  759.  
  760.     
  761.     
  762.     
  763.     
  764.    UWORD  fib_OwnerUID;         
  765.    UWORD  fib_OwnerGID;         
  766.  
  767.    char      fib_Reserved[32];
  768. };  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817. typedef long  BPTR;             
  818. typedef long  BSTR;             
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834. struct InfoData {
  835.    LONG      id_NumSoftErrors;     
  836.    LONG      id_UnitNumber;     
  837.    LONG      id_DiskState;         
  838.    LONG      id_NumBlocks;         
  839.    LONG      id_NumBlocksUsed;     
  840.    LONG      id_BytesPerBlock;
  841.    LONG      id_DiskType;         
  842.    BPTR      id_VolumeNode;     
  843.    LONG      id_InUse;         
  844. };  
  845.  
  846.  
  847.      
  848.  
  849.  
  850.  
  851.  
  852.      
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969. # 4 "../../include/powerup/gcclib/powerup_protos.h" 2
  970.  
  971.  
  972. # 1 "../../include/powerup/ppclib/object.h" 1
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038. struct ElfStreamMsg
  1039. {
  1040.     ULONG    Type;
  1041.     ULONG    Arg1;     
  1042.     ULONG    Arg2;     
  1043. };
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100. struct    PPCObjectInfo
  1101. {
  1102.     ULONG    Address;
  1103.  
  1104.  
  1105.  
  1106.  
  1107.     char    *Name;
  1108.  
  1109.  
  1110.     ULONG    Type;
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.     ULONG    SubType;
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.     ULONG    Binding;
  1129.  
  1130.  
  1131.     ULONG    Size;
  1132. };
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227. # 6 "../../include/powerup/gcclib/powerup_protos.h" 2
  1228.  
  1229.  
  1230.  
  1231.  
  1232. # 1 "include:intuition/classes.h" 1
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246. # 1 "include:utility/hooks.h" 1
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274. struct Hook
  1275. {
  1276.     struct MinNode h_MinNode;
  1277.     ULONG       (*h_Entry)(void);     
  1278.     ULONG       (*h_SubEntry)(void);     
  1279.     APTR       h_Data;         
  1280. };
  1281.  
  1282.  
  1283.  
  1284.  
  1285. typedef unsigned long (*HOOKFUNC)(void);
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347. # 14 "include:intuition/classes.h" 2
  1348.  
  1349.  
  1350.  
  1351.  
  1352. # 1 "include:intuition/classusr.h" 1
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371. typedef ULONG    Object;         
  1372.  
  1373. typedef    UBYTE    *ClassID;
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381. typedef struct {
  1382.     ULONG MethodID;
  1383.      
  1384. }        *Msg;
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429. struct opSet {
  1430.     ULONG        MethodID;
  1431.     struct TagItem    *ops_AttrList;     
  1432.     struct GadgetInfo    *ops_GInfo;     
  1433.  
  1434.  
  1435.  
  1436. };
  1437.  
  1438.  
  1439. struct opUpdate {
  1440.     ULONG        MethodID;
  1441.     struct TagItem    *opu_AttrList;     
  1442.     struct GadgetInfo    *opu_GInfo;     
  1443.  
  1444.  
  1445.  
  1446.     ULONG        opu_Flags;     
  1447. };
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459. struct opGet {
  1460.     ULONG        MethodID;
  1461.     ULONG        opg_AttrID;
  1462.     ULONG        *opg_Storage;     
  1463.  
  1464.  
  1465. };
  1466.  
  1467.  
  1468. struct opAddTail {
  1469.     ULONG        MethodID;
  1470.     struct List        *opat_List;
  1471. };
  1472.  
  1473.  
  1474.  
  1475. struct opMember {
  1476.     ULONG        MethodID;
  1477.     Object        *opam_Object;
  1478. };
  1479.  
  1480.  
  1481.  
  1482. # 18 "include:intuition/classes.h" 2
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491. typedef struct IClass {
  1492.     struct Hook        cl_Dispatcher;
  1493.     ULONG        cl_Reserved;     
  1494.     struct IClass    *cl_Super;
  1495.     ClassID        cl_ID;
  1496.  
  1497.      
  1498.     UWORD        cl_InstOffset;
  1499.     UWORD        cl_InstSize;
  1500.  
  1501.     ULONG        cl_UserData;     
  1502.     ULONG        cl_SubclassCount;
  1503.                      
  1504.     ULONG        cl_ObjectCount;
  1505.                  
  1506.     ULONG        cl_Flags;
  1507.  
  1508. } Class;
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531. struct _Object {
  1532.     struct MinNode    o_Node;
  1533.     struct IClass    *o_Class;
  1534. };
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549. # 10 "../../include/powerup/gcclib/powerup_protos.h" 2
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556. # 1 "include:stdarg.h" 1
  1557.  
  1558.  
  1559.  
  1560. # 72 "include:stdarg.h"
  1561.  
  1562. # 16 "../../include/powerup/gcclib/powerup_protos.h" 2
  1563.  
  1564.  
  1565. APTR    PPCAllocMem( unsigned long byteSize, unsigned long requirements );
  1566. void    PPCFreeMem( APTR memoryBlock, unsigned long byteSize );
  1567. APTR    PPCAllocVec( unsigned long byteSize, unsigned long requirements );
  1568. void    PPCFreeVec( APTR memoryBlock);
  1569. BPTR    PPCOutput(void);
  1570. BPTR    PPCInput(void);
  1571. BPTR    PPCOpen( STRPTR name, long accessMode );
  1572. LONG    PPCClose( BPTR file );
  1573. LONG    PPCRead( BPTR file, APTR buffer, long length );
  1574. LONG    PPCWrite( BPTR file, APTR buffer, long length );
  1575. LONG    PPCSeek( BPTR file, long position, long offset );
  1576. APTR    PPCCreatePool( unsigned long requirements, unsigned long puddleSize,
  1577.     unsigned long threshSize );
  1578. BOOL    PPCDeletePool( APTR poolHeader );
  1579. APTR    PPCAllocPooled( APTR poolHeader, unsigned long memSize );
  1580. void    PPCFreePooled( APTR poolHeader, APTR memory, unsigned long memSize );
  1581. APTR    PPCAllocVecPooled( APTR poolHeader, unsigned long memSize );
  1582. void    PPCFreeVecPooled( APTR poolHeader, APTR memory);
  1583. ULONG    PPCCallOS(struct Caos*);
  1584. ULONG    PPCCallM68k(struct Caos*);
  1585. ULONG    PPCSignal(void*,ULONG);
  1586. ULONG    PPCWait(ULONG);
  1587. void    *PPCFindTask(char*);
  1588. ULONG    PPCAllocSignal(ULONG);
  1589. void    PPCFreeSignal(ULONG);
  1590. void    PPCCacheFlush(APTR,ULONG);
  1591. void    PPCCacheFlushAll(void);
  1592. void    PPCCacheInvalid(APTR,ULONG);
  1593. ULONG    PPCSetSignal(ULONG,ULONG);
  1594. void    *PPCCreatePort(struct TagItem*);
  1595. BOOL    PPCDeletePort(void*);
  1596. void    *PPCObtainPort(struct TagItem*);
  1597. BOOL    PPCReleasePort(void*);
  1598. void    *PPCCreateMessage(void*,
  1599.                          ULONG);
  1600. void    PPCDeleteMessage(void*);
  1601. void    *PPCGetMessage(void*);
  1602. ULONG    PPCGetMessageAttr(void*,
  1603.                           ULONG);
  1604. BOOL    PPCReplyMessage(void*);
  1605. BOOL    PPCSendMessage(void*,
  1606.                        void*,
  1607.                        void*,
  1608.                        ULONG,
  1609.                        ULONG);
  1610. void    *PPCWaitPort(void*);
  1611.  
  1612. void*    PPCCreatePortList(void**,ULONG);
  1613. void    PPCDeletePortList(void*);
  1614. BOOL    PPCAddPortList(void*,
  1615.                        void*);
  1616. void    PPCRemPortList(void*,
  1617.                        void*);
  1618. void*    PPCWaitPortList(void*);
  1619. ULONG    PPCGetPortListAttr(void*,
  1620.                            ULONG);
  1621. void    PPCSetPortListAttr(void*,
  1622.                            ULONG,
  1623.                            ULONG);
  1624.  
  1625.  
  1626. int    strcmp(const char    *,
  1627.                const char    *);
  1628. char    *strcpy(char        *,
  1629.                 const char    *);
  1630. int    strlen(const char    *);
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639. void        PPCInsert(struct List    *,
  1640.                           struct Node    *,
  1641.                           struct Node    *);
  1642. void        PPCAddHead(struct List *,
  1643.                            struct Node *);
  1644. void        PPCAddTail(struct List *,
  1645.                            struct Node *);
  1646. void        PPCRemove(struct Node *);
  1647. struct Node*    PPCRemHead(struct List *);
  1648. struct Node*    PPCRemTail(struct List *);
  1649. void        PPCEnqueue(struct List*,
  1650.                            struct Node*);
  1651. struct Node*    PPCFindName(struct List*,
  1652.                             char*);
  1653. void        PPCNewList(struct List *);
  1654.  
  1655.  
  1656. void        PPCInsertSync(struct List    *,
  1657.                               struct Node    *,
  1658.                               struct Node    *);
  1659. void        PPCAddHeadSync(struct List *,
  1660.                                struct Node *);
  1661. void        PPCAddTailSync(struct List *,
  1662.                                struct Node *);
  1663. void        PPCRemoveSync(struct Node *);
  1664. struct Node*    PPCRemHeadSync(struct List *);
  1665. struct Node*    PPCRemTailSync(struct List *);
  1666. void        PPCEnqueueSync(struct List*,
  1667.                                struct Node*);
  1668. struct Node*    PPCFindNameSync(struct List*,
  1669.                                 char*);
  1670.  
  1671. struct TagItem*    PPCNextTagItem(struct TagItem**);
  1672. struct TagItem*    PPCFindTagItem(Tag,
  1673.                                struct TagItem*);
  1674. ULONG    PPCGetTagData(Tag,
  1675.                       ULONG,
  1676.                       struct TagItem *);
  1677.  
  1678. ULONG    PPCVersion(void);
  1679. ULONG    PPCRevision(void);
  1680.  
  1681. void    PPCReleaseSemaphore(void*);
  1682. void    PPCObtainSemaphore(void*);
  1683. LONG    PPCAttemptSemaphore(void*);
  1684. BOOL    PPCAttemptSemaphoreShared(void*);
  1685. void    PPCObtainSemaphoreShared(void*);
  1686. void*    PPCCreateSemaphore(struct TagItem*);
  1687. void    PPCDeleteSemaphore(void*);
  1688. void*    PPCObtainSemaphoreByName(char*);
  1689. void*    PPCAttemptSemaphoreByName(char*,
  1690.                                   ULONG*);
  1691.  
  1692. APTR    PPCRawDoFmt(UBYTE*,
  1693.                     APTR,
  1694.                     void (*)(),
  1695.                     APTR);
  1696.  
  1697. ULONG    PPCGetTaskAttr(ULONG);
  1698. void    PPCSetTaskAttr(ULONG,
  1699.                        ULONG);
  1700.  
  1701. void    PPCFinishTask(void);
  1702.  
  1703. ULONG    PPCGetAttr(ULONG);
  1704.  
  1705. UBYTE    PPCReadByte(UBYTE*);
  1706. UWORD    PPCReadWord(UWORD*);
  1707. ULONG    PPCReadLong(ULONG*);
  1708.  
  1709. void    PPCWriteByte(UBYTE*,UBYTE);
  1710. void    PPCWriteWord(UWORD*,UWORD);
  1711. void    PPCWriteLong(ULONG*,ULONG);
  1712.  
  1713. ULONG    PPCCoerceMethodA(struct IClass*,
  1714.                          Object*,
  1715.                          Msg);
  1716.  
  1717. ULONG    PPCDoMethodA(Object*,
  1718.                      Msg);
  1719.  
  1720. ULONG    PPCDoSuperMethodA(struct IClass*,
  1721.                           Object*,
  1722.                           void*);
  1723.  
  1724. void    PPCkprintf(const char*,
  1725.                    ...);
  1726.  
  1727. int    PPCprintf(const char*,
  1728.                   ...);
  1729.  
  1730. int    PPCsprintf(char*,
  1731.                    const char*,
  1732.                    ...);
  1733.  
  1734. void    PPCvkprintf(const char*,
  1735.                     va_list);
  1736.  
  1737. int    PPCvprintf(const char*,
  1738.                    va_list);
  1739.  
  1740. int    PPCvsprintf(char*,
  1741.                     const char*,
  1742.                     va_list);
  1743.  
  1744. int    PPCfprintf(BPTR,
  1745.                    const char        *FmtString,
  1746.                    ...);
  1747.  
  1748. int    PPCvfprintf(BPTR,
  1749.                     const char*,
  1750.                     va_list);
  1751.  
  1752. void    *PPCCreateTask(void*,
  1753.                        void*,
  1754.                        struct TagItem*);
  1755.  
  1756. void    *PPCOpenLibrary(void*,
  1757.                         struct TagItem*);
  1758.  
  1759. void    PPCCloseLibrary(void*);
  1760. void    *PPCGetLibSymbol(void*,
  1761.                          char*);
  1762.  
  1763.  
  1764. void    *PPCLoadObjectTagList(struct TagItem*);
  1765. void    *PPCLoadObject(char*);
  1766. void    PPCUnLoadObject(void*);
  1767. ULONG    PPCGetObjectAttrs(void*,
  1768.                           struct PPCObjectInfo*,
  1769.                           struct TagItem*);
  1770.  
  1771. void*    PPCCreateTimerObject(struct TagItem*);
  1772. void    PPCDeleteTimerObject(void*);
  1773.  
  1774.  
  1775. void    PPCSetTimerObject(void*,
  1776.                           ULONG,
  1777.                           unsigned long long*);
  1778.  
  1779. void    PPCGetTimerObject(void*,
  1780.                           ULONG,
  1781.                           unsigned long long*);
  1782. # 243 "../../include/powerup/gcclib/powerup_protos.h"
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792. int            __cmpdi2(long long, long long);
  1793. long long        __adddi3(long long, long long);
  1794. long long        __anddi3(long long, long long);
  1795. long long        __ashldi3(long long, unsigned int);
  1796. long long        __ashrdi3(long long, unsigned int);
  1797. long long        __lshldi3(long long, unsigned int);
  1798. long long        __lshrdi3(long long, unsigned int);
  1799. int            __cmpdi2(long long, long long );
  1800. long long        __divdi3(long long, long long);
  1801. long long        __fixdfdi(double);
  1802. long long        __fixsfdi(float);
  1803. unsigned long long    __fixunsdfdi(double);
  1804. unsigned long long    __fixunssfdi(float);
  1805. double            __floatdidf(long long);
  1806. float            __floatdisf(long long);
  1807. double            __floatunsdidf(unsigned long long);
  1808. long long        __iordi3(long long, long long);
  1809. long long        __moddi3(long long, long long);
  1810. long long        __muldi3(long long, long long);
  1811. long long        __negdi2(long long);
  1812.  
  1813. unsigned long long    __qdivrem(unsigned long long, unsigned long long, unsigned long long *);
  1814. long long        __subdi3(long long, long long);
  1815. int            __ucmpdi2(unsigned long long, unsigned long long);
  1816. unsigned long long    __udivdi3(unsigned long long, unsigned long long );
  1817. unsigned long long    __umoddi3(unsigned long long, unsigned long long );
  1818. long long        __xordi3(long long, long long);
  1819.  
  1820. long long    PPCAdd64(long long,long long);
  1821. long long    PPCSub64(long long,long long);
  1822. long long    PPCNeg64(long long);
  1823. BOOL        PPCCmp64(long long,long long);
  1824. long long    PPCMulu64(long long,long long);
  1825. long long    PPCDivu64(long long,long long);
  1826. long long    PPCMuls64(long long,long long);
  1827. long long    PPCDivs64(long long,long long);
  1828. long long    PPCModu64(long long,long long);
  1829. long long    PPCMods64(long long,long long);
  1830. long long    PPCLsr64(unsigned long long,unsigned int);
  1831. long long    PPCAsl64(long long,unsigned int);
  1832. long long    PPCAsr64(long long,unsigned int);
  1833. long long    PPCLsr64(unsigned long long,unsigned int);
  1834. long long    PPCOr64(unsigned long long,unsigned long long);
  1835. long long    PPCXor64(unsigned long long,unsigned long long);
  1836. long long    PPCAnd64(unsigned long long,unsigned long long);
  1837. long long    PPCDivRem64(long long,long long,long long*);
  1838.  
  1839. # 324 "../../include/powerup/gcclib/powerup_protos.h"
  1840.  
  1841.  
  1842.  
  1843. # 8 "PPCTimer.c" 2
  1844.  
  1845.  
  1846. int    main(void)
  1847. {
  1848. long long        Result;
  1849. long long        Ticks;
  1850. long long        TicksPerSec;
  1851. void            *MyTimerObject;
  1852. void            *MyTimerJob;
  1853. ULONG            b;
  1854. int            i;
  1855. struct TagItem        MyTags[4];
  1856. ULONG            MySignal;
  1857.  
  1858.   MyTags[0].ti_Tag    =    ((((ULONG)(1L<<31))  + 0x24000)  + 0x1) ;
  1859.   MyTags[0].ti_Data    =    1 ;
  1860.   MyTags[1].ti_Tag    =    (0L) ;
  1861.   if (MyTimerObject=PPCCreateTimerObject(MyTags))
  1862.   {
  1863.     PPCSetTimerObject(MyTimerObject,
  1864.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x11) ,
  1865.                       0L );
  1866.  
  1867.  
  1868.  
  1869.  
  1870.     PPCOutput();
  1871.  
  1872.     PPCSetTimerObject(MyTimerObject,
  1873.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x12) ,
  1874.                       0L );
  1875.  
  1876.  
  1877.     PPCGetTimerObject(MyTimerObject,
  1878.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x13) ,
  1879.                       &TicksPerSec);
  1880.  
  1881.     PPCprintf("TicksPerSec %Ld\n",TicksPerSec);
  1882.  
  1883.  
  1884.  
  1885.     PPCGetTimerObject(MyTimerObject,
  1886.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x11) ,
  1887.                       &Result);
  1888.  
  1889.     PPCprintf("StartTicks 0x%Lx\n",Result);
  1890.  
  1891.     PPCGetTimerObject(MyTimerObject,
  1892.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x12) ,
  1893.                       &Result);
  1894.  
  1895.     PPCprintf("StopTicks 0x%Lx\n",Result);
  1896.  
  1897.  
  1898.  
  1899.     PPCGetTimerObject(MyTimerObject,
  1900.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x14) ,
  1901.                       &Result);
  1902.     PPCprintf("Current 0x%Lx\n",Result);
  1903.  
  1904.  
  1905.  
  1906.     PPCGetTimerObject(MyTimerObject,
  1907.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x15) ,
  1908.                       &Result);
  1909.     PPCprintf("DiffTicks %Ld\n",Result);
  1910.  
  1911.  
  1912.     PPCprintf("PPCOutput() context switch took %4g seconds\n",
  1913.               (((double) (Result) / (double)TicksPerSec)));
  1914. __asm("twi 31,0,0\n");
  1915.     PPCGetTimerObject(MyTimerObject,
  1916.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x16) ,
  1917.                       &Result);
  1918.     PPCprintf("DiffMicro %Ld\n",Result);
  1919.  
  1920.  
  1921.     PPCGetTimerObject(MyTimerObject,
  1922.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x17) ,
  1923.                       &Result);
  1924.     PPCprintf("DiffSecs %Ld\n",Result);
  1925.  
  1926.  
  1927.     PPCGetTimerObject(MyTimerObject,
  1928.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x18) ,
  1929.                       &Result);
  1930.     PPCprintf("DiffMins %Ld\n",Result);
  1931.  
  1932.  
  1933.     PPCGetTimerObject(MyTimerObject,
  1934.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x19) ,
  1935.                       &Result);
  1936.     PPCprintf("DiffHours %Ld\n",Result);
  1937.  
  1938.  
  1939.     PPCGetTimerObject(MyTimerObject,
  1940.                       ((((ULONG)(1L<<31))  + 0x24000)  + 0x1a) ,
  1941.                       &Result);
  1942.     PPCprintf("DiffDays %Ld\n",Result);
  1943.  
  1944.  
  1945.     PPCprintf("Use 50Hz Timer to wait 4 seconds\n");
  1946.  
  1947.     if ((MySignal==PPCAllocSignal(-1)) != -1)
  1948.     {
  1949.       MyTags[0].ti_Tag    =    ((((ULONG)(1L<<31))  + 0x24000)  + 0x2) ;
  1950.       MyTags[0].ti_Data    =    50*4;
  1951.       MyTags[1].ti_Tag    =    ((((ULONG)(1L<<31))  + 0x24000)  + 0x3) ;
  1952.       MyTags[1].ti_Data    =    1<<MySignal;
  1953.        
  1954.  
  1955.  
  1956.       MyTags[2].ti_Tag    =    ((((ULONG)(1L<<31))  + 0x24000)  + 0x4) ;
  1957.       MyTags[2].ti_Data    =    1 ;
  1958.       MyTags[3].ti_Tag    =    (0L) ;
  1959.  
  1960.       PPCSetTimerObject(MyTimerObject,
  1961.                         ((((ULONG)(1L<<31))  + 0x24000)  + 0x11) ,
  1962.                         0L );
  1963.  
  1964.       if (MyTimerJob=PPCCreateTimerObject(MyTags))
  1965.       {
  1966.         PPCWait(1<<MySignal);
  1967.         PPCSetTimerObject(MyTimerObject,
  1968.                           ((((ULONG)(1L<<31))  + 0x24000)  + 0x12) ,
  1969.                           0L );
  1970.  
  1971.         PPCprintf("notification received\n");
  1972.         PPCDeleteTimerObject(MyTimerJob);
  1973.  
  1974.         PPCGetTimerObject(MyTimerObject,
  1975.                           ((((ULONG)(1L<<31))  + 0x24000)  + 0x15) ,
  1976.                           &Ticks);
  1977.  
  1978.         PPCprintf("DiffTicks %Ld\n",Ticks);
  1979.  
  1980.         PPCprintf("waited for %g seconds\n",
  1981.                   ((double) Ticks) / TicksPerSec);
  1982.  
  1983.  
  1984.       }
  1985.       PPCFreeSignal(MySignal);
  1986.     }
  1987.     else
  1988.     {
  1989.       PPCprintf("Couldn`t alloc Signal\n");
  1990.     }
  1991.  
  1992.     PPCDeleteTimerObject(MyTimerObject);
  1993.   }
  1994. }
  1995.  
  1996.